package com.umeng.analytics.pro;

import android.content.Context;

import com.umeng.analytics.AnalyticsConfig;

public class bi implements az {
    private final long a;
    private final long b;
    private final int c;
    private final int d;
    private cc e;
    private be f;
    private long g;
    private int h;
    private long i;
    private long j;
    private Context k;
    private static bi l;

    static {
        bi.l = null;
    }

    private bi(Context arg9, be arg10) {

        this.a = 1296000000;
        this.b = 129600000;
        this.c = 1800000;
        this.d = 10000;
        this.g = 1296000000;
        this.h = 10000;
        this.i = 0;
        this.j = 0;
        this.k = arg9;
        this.e = cc.a(arg9);
        this.f = arg10;
    }

    public static bi a(Context arg3, be arg4) {
        bi v0_1;
        Class v1 = bi.class;
        synchronized (v1) {
            if (bi.l == null) {
                v0_1 = new bi(arg3, arg4);
                bi.l = v0_1;
                v0_1.a(af.a(arg3).b());
            }
            v0_1 = bi.l;
        }
        return v0_1;
    }

    public void a(af.a arg3) {
        this.g = arg3.a(1296000000);
        int v0 = arg3.b(0);
        if (v0 == 0) {
            if (AnalyticsConfig.sLatentWindow > 0 && AnalyticsConfig.sLatentWindow <= 1800000) {
                this.h = AnalyticsConfig.sLatentWindow;
                return;
            }

            this.h = 10000;
        } else {
            this.h = v0;
        }
    }

    public boolean a() {
        boolean v0 = false;
        if (!this.e.h() && !this.f.f()) {
            long v2 = System.currentTimeMillis() - this.f.m();
            if (v2 > this.g) {
                this.i = ((long) bt.a(this.h, aa.a(this.k)));
                this.j = v2;
                v0 = true;
            } else if (v2 > 129600000) {
                this.i = 0;
                this.j = v2;
                v0 = true;
            }
        }

        return v0;
    }

    public long b() {
        return this.i;
    }

    public long c() {
        return this.j;
    }
}

